using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GuaXianInfoLoad : MonoBehaviour
{

    public TextAsset text;
    
    
    public List<GuaXian>  Gua =new List<GuaXian>();

    public static GuaXianInfoLoad instance;
    private void Awake()
    {
        if(instance==null)
        instance = this;
    }
    // Start is called before the first frame update
    void Start()
    {
        LoadtheGuaXian();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    void LoadtheGuaXian()
    {
        string[] dataRow = text.text.Split('\n');

        foreach (var row in dataRow)
        {
            GuaXian gua=new GuaXian();
            
            string[] rowArray = row.Split(',');
           if(rowArray[0]=="$"||rowArray[0]=="")
            {
                continue;
            }
                gua.NO = int.Parse(rowArray[0]);
                gua.Name = rowArray[1];
                gua.ImageName=rowArray[2];
                gua.MainWuxing=int.Parse(rowArray[3]);
                gua.YingYang=rowArray[4];
                gua.meaning=rowArray[5];
                gua.Guashu=rowArray[6];
                Debug.Log("aa");
               Gua.Add(gua); 
            
        }
    }
}
